<html>
<head><meta charset="utf-8"><title>Extend Rustc&#x27;s folder trait to have a Result associated type · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html">Extend Rustc&#x27;s folder trait to have a Result associated type</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="239154032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239154032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239154032">(May 17 2021 at 20:22)</a>:</h4>
<p>I've started working on the "Extend Rustc's folder trait to have a <code>Result</code> associated type" from <a href="https://github.com/rust-lang/wg-traits/issues/16">wg-traits#16</a>. I think I'll need it to fix <a href="https://github.com/rust-lang/rust/issues/85103">#85103</a> as well.</p>
<p>Can someone confirm that this is still something that the WG wants? If so, I'll probably need to open a MCP, is there anyone in particular that would want to second it?</p>



<a name="239155059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239155059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239155059">(May 17 2021 at 20:30)</a>:</h4>
<p>How will added an associated type on <code>TypeFoldable</code> help with <a href="https://github.com/rust-lang/rust/issues/85103">#85103</a></p>



<a name="239155213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239155213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239155213">(May 17 2021 at 20:31)</a>:</h4>
<p>My idea to fix <a href="https://github.com/rust-lang/rust/issues/85103">#85103</a> is to make the <code>normalize_*</code> queries return a <code>Result</code></p>



<a name="239155259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239155259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239155259">(May 17 2021 at 20:31)</a>:</h4>
<p>But normalization uses <code>TypeFolder</code> to do its work</p>



<a name="239155569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239155569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239155569">(May 17 2021 at 20:33)</a>:</h4>
<p>Ah okay, so on <code>TypeFolder</code> (equivalent to Chalks <code>Fold</code>)</p>



<a name="239155870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239155870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239155870">(May 17 2021 at 20:35)</a>:</h4>
<p>I will say that the work I'm doing on normalizing projections under binders will automatically fix this issue</p>



<a name="239155946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239155946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239155946">(May 17 2021 at 20:35)</a>:</h4>
<p>However, for adding a <code>Result</code> associated type on <code>TypeFolder</code></p>



<a name="239156037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239156037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239156037">(May 17 2021 at 20:36)</a>:</h4>
<p>I think we should look at the implementation of <code>Fold</code> in Chalk and see if there are actually any implementations that use that</p>



<a name="239156395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239156395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239156395">(May 17 2021 at 20:38)</a>:</h4>
<p>I don't actually see any impls in Chalk that have a <code>Result</code> that is <em>not</em> <code>Self</code></p>



<a name="239156649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239156649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239156649">(May 17 2021 at 20:40)</a>:</h4>
<p>What <em>should</em> be on the list, but isn't, is that <code>TypeFoldable</code> returns <code>Self</code> from <code>fold_with</code> while all the functions in <code>Folder</code> return <code>Fallible</code></p>



<a name="239156766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239156766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239156766">(May 17 2021 at 20:41)</a>:</h4>
<p>Which <span class="user-mention" data-user-id="255061">@Léo Lanteri Thauvin</span> is probably what would help</p>



<a name="239156824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239156824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239156824">(May 17 2021 at 20:42)</a>:</h4>
<p>Not so much the <code>Result</code> on <code>TypeFolder</code></p>



<a name="239156961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239156961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239156961">(May 17 2021 at 20:43)</a>:</h4>
<p>I'm not sure I understand. If functions in <code>TypeFolder</code> return <code>Fallible</code> (or <code>Result</code> or whatever), wouldn't the functions in <code>TypeFoldable</code> need to return <code>Fallible</code> too?</p>



<a name="239157224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239157224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239157224">(May 17 2021 at 20:45)</a>:</h4>
<p>Well</p>



<a name="239157396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239157396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239157396">(May 17 2021 at 20:47)</a>:</h4>
<p><code>TypeFolder</code> (or Chalk's <code>Fold</code>) don't necessarily have to return a "Result"</p>



<a name="239157481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239157481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239157481">(May 17 2021 at 20:47)</a>:</h4>
<p>Part of this is that Chalk's version of "type folding" is quite different from rustc's version</p>



<a name="239157482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239157482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239157482">(May 17 2021 at 20:47)</a>:</h4>
<p>Basically the definitions I have now are:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">pub</span><span class="w"> </span><span class="k">trait</span><span class="w"> </span><span class="n">TypeFoldable</span><span class="o">&lt;'</span><span class="na">tcx</span><span class="o">&gt;</span>: <span class="nc">fmt</span>::<span class="n">Debug</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nb">Clone</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">super_fold_with</span><span class="o">&lt;</span><span class="n">F</span>: <span class="nc">TypeFolder</span><span class="o">&lt;'</span><span class="na">tcx</span><span class="o">&gt;&gt;</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">folder</span>: <span class="kp">&amp;</span><span class="nc">mut</span><span class="w"> </span><span class="n">F</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nb">Result</span><span class="o">&lt;</span><span class="bp">Self</span><span class="p">,</span><span class="w"> </span><span class="n">F</span>::<span class="n">Error</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">fold_with</span><span class="o">&lt;</span><span class="n">F</span>: <span class="nc">TypeFolder</span><span class="o">&lt;'</span><span class="na">tcx</span><span class="o">&gt;&gt;</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">folder</span>: <span class="kp">&amp;</span><span class="nc">mut</span><span class="w"> </span><span class="n">F</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nb">Result</span><span class="o">&lt;</span><span class="bp">Self</span><span class="p">,</span><span class="w"> </span><span class="n">F</span>::<span class="n">Error</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="bp">self</span><span class="p">.</span><span class="n">super_fold_with</span><span class="p">(</span><span class="n">folder</span><span class="p">)</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="c1">// ... unrelated functions</span>
<span class="p">}</span><span class="w"></span>

<span class="k">pub</span><span class="w"> </span><span class="k">trait</span><span class="w"> </span><span class="n">TypeFolder</span><span class="o">&lt;'</span><span class="na">tcx</span><span class="o">&gt;</span>: <span class="nb">Sized</span> <span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">Error</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">!</span><span class="p">;</span><span class="w"></span>

<span class="w">    </span><span class="k">fn</span> <span class="nf">tcx</span><span class="o">&lt;'</span><span class="na">a</span><span class="o">&gt;</span><span class="p">(</span><span class="o">&amp;'</span><span class="na">a</span><span class="w"> </span><span class="bp">self</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">TyCtxt</span><span class="o">&lt;'</span><span class="na">tcx</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>

<span class="w">    </span><span class="k">fn</span> <span class="nf">fold_xxx</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">t</span>: <span class="nc">Ty</span><span class="o">&lt;'</span><span class="na">tcx</span><span class="o">&gt;</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nb">Result</span><span class="o">&lt;</span><span class="n">XXX</span><span class="p">,</span><span class="w"> </span><span class="bp">Self</span>::<span class="n">Error</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="n">t</span><span class="p">.</span><span class="n">super_fold_with</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="239157589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239157589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239157589">(May 17 2021 at 20:48)</a>:</h4>
<p>I forgot about the need to fix these discrepancies</p>



<a name="239157594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239157594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239157594">(May 17 2021 at 20:48)</a>:</h4>
<p>we should add this to our project board :)</p>



<a name="239157612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239157612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239157612">(May 17 2021 at 20:48)</a>:</h4>
<p>Oh I see..</p>



<a name="239157628"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239157628" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239157628">(May 17 2021 at 20:48)</a>:</h4>
<p>You're right <span class="user-mention" data-user-id="255061">@Léo Lanteri Thauvin</span></p>



<a name="239157654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239157654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239157654">(May 17 2021 at 20:48)</a>:</h4>
<p>In Chalk's setup, <code>Fold</code> doesn't need the <code>Result</code></p>



<a name="239157696"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239157696" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239157696">(May 17 2021 at 20:49)</a>:</h4>
<p>But it does have it currently?</p>



<a name="239157749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239157749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239157749">(May 17 2021 at 20:49)</a>:</h4>
<p>erg</p>



<a name="239157775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239157775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239157775">(May 17 2021 at 20:49)</a>:</h4>
<p>I'm confused</p>



<a name="239157783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239157783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239157783">(May 17 2021 at 20:49)</a>:</h4>
<p>(I see that the <code>fold_*</code> return <code>Fallible</code>)</p>



<a name="239157799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239157799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239157799">(May 17 2021 at 20:49)</a>:</h4>
<p>It doesn't need the associated type</p>



<a name="239157820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239157820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239157820">(May 17 2021 at 20:49)</a>:</h4>
<p>it needs the <code>Fallible</code></p>



<a name="239157911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239157911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239157911">(May 17 2021 at 20:50)</a>:</h4>
<p>Right, because in some sense the associated type is always <code>NoSolution</code></p>



<a name="239157960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239157960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239157960">(May 17 2021 at 20:50)</a>:</h4>
<p>no</p>



<a name="239157999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239157999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239157999">(May 17 2021 at 20:50)</a>:</h4>
<p>The <code>Result</code> type is not the <code>Error</code> type, but the <code>Success</code> type</p>



<a name="239158041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239158041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239158041">(May 17 2021 at 20:51)</a>:</h4>
<p>I think we can probably remove <em>that</em></p>



<a name="239158078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239158078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239158078">(May 17 2021 at 20:51)</a>:</h4>
<p>But move rustc to return <code>Fallible</code> for sure</p>



<a name="239158170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239158170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239158170">(May 17 2021 at 20:51)</a>:</h4>
<p>Oh sorry I see what you mean</p>



<a name="239158183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239158183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239158183">(May 17 2021 at 20:51)</a>:</h4>
<p>It would just be <code>Result&lt;Self, NoSolution&gt;</code></p>



<a name="239158223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239158223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239158223">(May 17 2021 at 20:51)</a>:</h4>
<p>I confused myself with <code>Folder</code> and <code>Fold</code></p>



<a name="239158270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239158270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239158270">(May 17 2021 at 20:52)</a>:</h4>
<p>Oh, I definitely got confused a bit here</p>



<a name="239158389"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239158389" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239158389">(May 17 2021 at 20:52)</a>:</h4>
<p>So we don't need a <code>Fold::Result</code> but I think we could use a <code>Folder::Error</code> associated type</p>



<a name="239158462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239158462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239158462">(May 17 2021 at 20:53)</a>:</h4>
<p><code>Folder</code>/<code>TypeFoldable</code>...maybe</p>



<a name="239158477"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239158477" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239158477">(May 17 2021 at 20:53)</a>:</h4>
<p>Or just <code>NoSolution</code></p>



<a name="239158511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239158511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239158511">(May 17 2021 at 20:53)</a>:</h4>
<p>So that all the folders in rustc that always succeed can use <code>Error = !</code></p>



<a name="239158535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239158535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239158535">(May 17 2021 at 20:53)</a>:</h4>
<p>We/someone should do a writeup on the differences between Chalk and rustc's folding/visiting implementations</p>



<a name="239158595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239158595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239158595">(May 17 2021 at 20:53)</a>:</h4>
<p><span class="user-mention silent" data-user-id="255061">Léo Lanteri Thauvin</span> <a href="#narrow/stream/144729-wg-traits/topic/Extend.20Rustc's.20folder.20trait.20to.20have.20a.20Result.20associated.20type/near/239158511">said</a>:</p>
<blockquote>
<p>So that all the folders in rustc that always succeed can use <code>Error = !</code></p>
</blockquote>
<p>I like that</p>



<a name="239158686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239158686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239158686">(May 17 2021 at 20:54)</a>:</h4>
<p>(Kind of like we had done with <code>TypeVisitor</code>)</p>



<a name="239158865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239158865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239158865">(May 17 2021 at 20:55)</a>:</h4>
<p>Yeah, was thinking about that</p>



<a name="239158970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239158970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239158970">(May 17 2021 at 20:56)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/Extend.20Rustc's.20folder.20trait.20to.20have.20a.20Result.20associated.20type/near/239158535">said</a>:</p>
<blockquote>
<p>We/someone should do a writeup on the differences between Chalk and rustc's folding/visiting implementations</p>
</blockquote>
<p>I could maybe help with the rustc part, especially if I end up implementing the changes we just discussed, but I know nothing about chalk <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="239158984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239158984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239158984">(May 17 2021 at 20:56)</a>:</h4>
<p>Chalk's <code>visit_with</code> takes the break value as a generic</p>



<a name="239159005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239159005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239159005">(May 17 2021 at 20:56)</a>:</h4>
<p>instead of it being a associated type...</p>



<a name="239159104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239159104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239159104">(May 17 2021 at 20:57)</a>:</h4>
<p>It is an associated type on <code>Visitor</code></p>



<a name="239159177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239159177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239159177">(May 17 2021 at 20:58)</a>:</h4>
<p>Right</p>



<a name="239159234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239159234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239159234">(May 17 2021 at 20:58)</a>:</h4>
<p>(I vaguely remember implementing that as a follow-up to doing it in rustc)</p>



<a name="239159344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239159344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239159344">(May 17 2021 at 20:59)</a>:</h4>
<p>So the generic is constrained to be the visitor's <code>Break</code> type</p>



<a name="239159555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239159555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239159555">(May 17 2021 at 21:00)</a>:</h4>
<p>yes</p>



<a name="239159872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239159872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239159872">(May 17 2021 at 21:02)</a>:</h4>
<p>Right so <code>Visitor</code> = <code>TypeVisitor</code>, and both have the <code>BreakTy</code></p>



<a name="239159958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239159958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239159958">(May 17 2021 at 21:03)</a>:</h4>
<p>But <code>visit_with</code> is on <code>Visit</code></p>



<a name="239160135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239160135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239160135">(May 17 2021 at 21:04)</a>:</h4>
<p>In rustc <code>TypeFoldable</code> seems to be <code>Fold + Visit</code> together</p>



<a name="239160224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239160224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239160224">(May 17 2021 at 21:05)</a>:</h4>
<p>yes</p>



<a name="239160228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239160228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239160228">(May 17 2021 at 21:05)</a>:</h4>
<p>okay I've got things more straight in my mind</p>



<a name="239160411"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239160411" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239160411">(May 17 2021 at 21:06)</a>:</h4>
<p>So you think we should do this? i.e. introduce a <code>TypeFolder::Error</code> associated type in <code>rustc</code></p>



<a name="239160459"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239160459" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239160459">(May 17 2021 at 21:06)</a>:</h4>
<p>yes, and to <code>Folder</code> in Chalk</p>



<a name="239160468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239160468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239160468">(May 17 2021 at 21:07)</a>:</h4>
<p>It's only a matter of fixing <em>a few hundred</em> errors, nothing too bad <span aria-label="innocent" class="emoji emoji-1f607" role="img" title="innocent">:innocent:</span></p>



<a name="239160758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239160758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239160758">(May 17 2021 at 21:09)</a>:</h4>
<p>I guess we have the <code>B</code> generic on <code>visit_with</code> because we take <code>Folder</code> by <code>dyn</code></p>



<a name="239160927"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239160927" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239160927">(May 17 2021 at 21:10)</a>:</h4>
<p>Do you want me to open a MCP?</p>



<a name="239161037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239161037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239161037">(May 17 2021 at 21:11)</a>:</h4>
<p>You can</p>



<a name="239161043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239161043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239161043">(May 17 2021 at 21:11)</a>:</h4>
<p>I'll second it</p>



<a name="239162573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239162573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239162573">(May 17 2021 at 21:22)</a>:</h4>
<p>One note for that writeup (completely unneeded atm, but I was curious): <code>visit_binder</code> in <code>TypeVisitor</code> isn't used for anything except for incrementing the binding depth and <code>fold_binder</code> isn't used for anything but incrementing the binding depth <em>and</em> anonymizing regions in <code>RegionEraserVisitor</code></p>



<a name="239163650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239163650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239163650">(May 17 2021 at 21:32)</a>:</h4>
<p><a href="https://github.com/rust-lang/compiler-team/issues/432">compiler-team#432</a></p>



<a name="239421511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239421511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239421511">(May 19 2021 at 13:15)</a>:</h4>
<p>Opened <a href="https://github.com/rust-lang/rust/issues/85469">#85469</a></p>



<a name="239421753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239421753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239421753">(May 19 2021 at 13:17)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> I think we should have a perf run to check that the impact is neutral?</p>



<a name="239422209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239422209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239422209">(May 19 2021 at 13:19)</a>:</h4>
<p><span class="user-mention" data-user-id="255061">@Léo Lanteri Thauvin</span> taking a look!</p>



<a name="239454454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239454454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239454454">(May 19 2021 at 16:21)</a>:</h4>
<p><span class="user-mention" data-user-id="255061">@Léo Lanteri Thauvin</span> Just briefly skimming your PR. I think you use <code>.unwrap()</code> in a bunch of places when we have a <code>Result&lt;T, !&gt;</code>. Can you use <code>into_ok</code> instead?</p>



<a name="239454627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239454627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239454627">(May 19 2021 at 16:22)</a>:</h4>
<p>Oh, whoops, I forgot <code>into_ok</code> existed</p>



<a name="239454635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239454635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239454635">(May 19 2021 at 16:22)</a>:</h4>
<p>Will do</p>



<a name="239454688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239454688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239454688">(May 19 2021 at 16:23)</a>:</h4>
<p>It's under a feature gate, but I think in this case it makes sense :)</p>



<a name="239454833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239454833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239454833">(May 19 2021 at 16:24)</a>:</h4>
<p>Right, we won't risk changing the <code>Error</code> and forgetting some <code>unwrap</code>s</p>



<a name="239454880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239454880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239454880">(May 19 2021 at 16:24)</a>:</h4>
<p>Exactly</p>



<a name="239461377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239461377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239461377">(May 19 2021 at 17:07)</a>:</h4>
<p>Done</p>



<a name="239476880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239476880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239476880">(May 19 2021 at 18:47)</a>:</h4>
<p><span class="user-mention" data-user-id="255061">@Léo Lanteri Thauvin</span> so I wonder if we should redo the perf run now with <code>into_ok</code></p>



<a name="239476936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239476936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239476936">(May 19 2021 at 18:47)</a>:</h4>
<p>I wonder if instructions changed any</p>



<a name="239477037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239477037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239477037">(May 19 2021 at 18:47)</a>:</h4>
<p>Instruction counts regression several percent on several tests</p>



<a name="239477039"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239477039" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239477039">(May 19 2021 at 18:47)</a>:</h4>
<p><span aria-label="shrug" class="emoji emoji-1f937" role="img" title="shrug">:shrug:</span></p>



<a name="239477117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239477117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239477117">(May 19 2021 at 18:48)</a>:</h4>
<p>But actual wall time doesn't look nearly as bad (~3%)</p>



<a name="239477200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239477200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239477200">(May 19 2021 at 18:49)</a>:</h4>
<p>I don't understand how this can be an improvement in the first place, looks like magic to me <span aria-label="sparkles" class="emoji emoji-2728" role="img" title="sparkles">:sparkles:</span></p>



<a name="239477362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239477362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239477362">(May 19 2021 at 18:50)</a>:</h4>
<p>It's really pretty variable</p>



<a name="239477951"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/239477951" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#239477951">(May 19 2021 at 18:54)</a>:</h4>
<p>Looks like <code>typeck</code> is taking longer: <a href="https://perf.rust-lang.org/detailed-query.html?commit=dd302a4b134912d6af2e70defbb3418a9a4f08a7&amp;base_commit=3e827cc21e0734edd26170e8d1481f0d66a1426b&amp;benchmark=keccak-check&amp;run_name=full">https://perf.rust-lang.org/detailed-query.html?commit=dd302a4b134912d6af2e70defbb3418a9a4f08a7&amp;base_commit=3e827cc21e0734edd26170e8d1481f0d66a1426b&amp;benchmark=keccak-check&amp;run_name=full</a></p>



<a name="240058715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/240058715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#240058715">(May 24 2021 at 14:28)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> So do you want to run more perf tests? If you want to test the impact of changing <code>unwrap</code> to <code>into_ok</code> let me know so I drop the last commit</p>



<a name="240059985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/240059985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#240059985">(May 24 2021 at 14:38)</a>:</h4>
<p>I think it's fine</p>



<a name="240060091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/240060091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#240060091">(May 24 2021 at 14:38)</a>:</h4>
<p>err no. 6% regressions on instruction counts for multiple tests</p>



<a name="240060099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/240060099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#240060099">(May 24 2021 at 14:39)</a>:</h4>
<p>I'm going to queue a perf run</p>



<a name="240095338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/240095338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#240095338">(May 24 2021 at 18:56)</a>:</h4>
<p>Bleh so perf is just as bad. Wall times are more mixed, but lots of red</p>



<a name="240095365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/240095365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#240095365">(May 24 2021 at 18:56)</a>:</h4>
<p>Should really try to dig into it</p>



<a name="240095431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/240095431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#240095431">(May 24 2021 at 18:57)</a>:</h4>
<p>I noticed the perf dashboard has a link to flamegraphs, but links don't work</p>



<a name="240095470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/240095470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#240095470">(May 24 2021 at 18:57)</a>:</h4>
<p>It's a known issue</p>



<a name="240095580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/240095580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#240095580">(May 24 2021 at 18:58)</a>:</h4>
<p><a href="https://github.com/rust-lang/rustc-perf/issues/851">https://github.com/rust-lang/rustc-perf/issues/851</a></p>



<a name="240096948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/240096948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#240096948">(May 24 2021 at 19:07)</a>:</h4>
<p>those are likely not useful anyway for stuff like this</p>



<a name="240096962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/240096962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#240096962">(May 24 2021 at 19:07)</a>:</h4>
<p>you want cachegrind-level info, most likely</p>



<a name="240102469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/240102469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#240102469">(May 24 2021 at 19:49)</a>:</h4>
<blockquote>
<p>If you are going to use any of the profilers that rely on line numbers (OProfile, Cachegrind, Callgrind, DHAT, or Massif) use the following <code>config.toml</code> file for your local build.</p>
</blockquote>
<div class="codehilite" data-code-language="TOML"><pre><span></span><code><span class="k">[llvm]</span>
<span class="n">release-debuginfo</span> <span class="o">=</span> <span class="kc">true</span>
<span class="k">[rust]</span>
<span class="n">debuginfo-level</span> <span class="o">=</span> <span class="mi">1</span>
</code></pre></div>
<p>Does CI produce artifacts with those enabled?</p>



<a name="240105417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/240105417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#240105417">(May 24 2021 at 20:12)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> I’m not sure you’ll have the time so we can finish my PR unifying both measureme format APIs, but do you think we may want to switch those links mentioned above around (so that the most recent data has working processed links, and only the runs on the previous measureme format will 500) ?</p>



<a name="240119862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/240119862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#240119862">(May 24 2021 at 22:17)</a>:</h4>
<p>hm</p>



<a name="240119874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/240119874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#240119874">(May 24 2021 at 22:17)</a>:</h4>
<p>yeah it's not a bad idea, just haven't had much time lately</p>



<a name="241301620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/241301620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#241301620">(Jun 02 2021 at 18:40)</a>:</h4>
<p>So I've ran cachegrind through the rustc-perf profiler</p>



<a name="241301896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/241301896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#241301896">(Jun 02 2021 at 18:42)</a>:</h4>
<p>Now I have cachegrind output files, how do I make sense of them? I've tried using <code>cg_diff</code> but it just outputs a 170000 lines output <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="241305981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Extend%20Rustc%27s%20folder%20trait%20to%20have%20a%20Result%20associated%20type/near/241305981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Extend.20Rustc&#x27;s.20folder.20trait.20to.20have.20a.20Result.20associated.20type.html#241305981">(Jun 02 2021 at 19:15)</a>:</h4>
<p>Hmm, maybe ping <span class="user-mention" data-user-id="120989">@njn</span> and see if he'll help you :)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>